/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright(c) 2023 Huawei Technologies Co., Ltd */

#ifndef HINIC3_LLD_HIUDK_H
#define HINIC3_LLD_HIUDK_H
#ifdef HIUDK_SDK
struct hiudk_sdk g_sdk_drv = {
    .hiudk_register_uld = hinic3_register_uld,
    .hiudk_unregister_uld = hinic3_unregister_uld,
    .hiudk_get_lld_dev_by_dev_name = hinic3_get_lld_dev_by_dev_name,
    .hiudk_get_lld_dev_by_dev_name_unsafe = hinic3_get_lld_dev_by_dev_name_unsafe,
    .hiudk_get_lld_dev_by_chip_and_port = hinic3_get_lld_dev_by_chip_and_port,
    .hiudk_get_ppf_dev = hinic3_get_ppf_dev,
    .sdk_lable = "HWSDK",
    .idx = UDK_MAX_SDK
};

struct hiudk_ops g_sdk_ops = {
    /* crm_ops */
    {
        .hiudk_alloc_ceqs = hinic3_alloc_ceqs,
        .hiudk_alloc_irqs = hinic3_alloc_irqs,
        .hiudk_ceq_num = hinic3_ceq_num,
        .hiudk_cos_valid_bitmap = hinic3_cos_valid_bitmap,
        .hiudk_ep_id = hinic3_ep_id,
        .hiudk_er_id = hinic3_er_id,
        .hiudk_fault_event_report = hinic3_fault_event_report,
        .hiudk_flexq_en = hinic3_flexq_en,
        .hiudk_host_pf_num = hinic3_host_pf_num,
        .hiudk_host_pf_id_start = hinic3_host_pf_id_start,
        .hiudk_free_ceq = hinic3_free_ceq,
        .hiudk_free_irq = hinic3_free_irq,
        .hiudk_func_max_qnum = hinic3_func_max_qnum,
        .hiudk_func_max_vf = hinic3_func_max_vf,
        .hiudk_func_rx_tx_flush = hinic3_func_rx_tx_flush,
        .hiudk_func_type = hinic3_func_type,
        .hiudk_get_card_present_state = hinic3_get_card_present_state,
        .hiudk_get_chip_present_flag = hinic3_get_chip_present_flag,
        .hiudk_get_fw_version = hinic3_get_fw_version,
        .hiudk_get_heartbeat_status = hinic3_get_heartbeat_status,
        .hiudk_get_mgmt_version = hinic3_get_mgmt_version,
        .hiudk_get_stateful_enable = hinic3_get_stateful_enable,
        .hiudk_get_timer_enable = hinic3_get_timer_enable,
        .hiudk_glb_pf_vf_offset = hinic3_glb_pf_vf_offset,
        .hiudk_get_bond_create_mode = hinic3_get_bond_create_mode,
        .hiudk_global_func_id = hinic3_global_func_id,
        .hiudk_host_id = hinic3_host_id,
        .hiudk_host_oq_id_mask = hinic3_host_oq_id_mask,
        .hiudk_host_total_func = hinic3_host_total_func,
        .hiudk_intr_num = hinic3_intr_num,
        .hiudk_max_pf_num = hinic3_max_pf_num,
        .hiudk_misx_intr_clear_resend_bit = hinic3_misx_intr_clear_resend_bit,
        .hiudk_pcie_itf_id = hinic3_pcie_itf_id,
        .hiudk_pf_id_of_vf = hinic3_pf_id_of_vf,
        .hiudk_physical_port_id = hinic3_physical_port_id,
        .hiudk_ppf_idx = hinic3_ppf_idx,
        .hiudk_set_func_svc_used_state = hinic3_set_func_svc_used_state,
        .hiudk_set_interrupt_cfg = hinic3_set_interrupt_cfg,
        .hiudk_set_msix_auto_mask_state = hinic3_set_msix_auto_mask_state,
        .hiudk_set_msix_state = hinic3_set_msix_state,
        .hiudk_set_ppf_flr_type = hinic3_set_ppf_flr_type,
        .hiudk_set_ppf_tbl_hotreplace_flag = hinic3_set_ppf_tbl_hotreplace_flag,
        .hiudk_stateful_deinit = hinic3_stateful_deinit,
        .hiudk_stateful_init = hinic3_stateful_init,
        .hiudk_support_ppa = hinic3_support_ppa,
        .hiudk_support_fc = hinic3_support_fc,
        .hiudk_support_ipsec = hinic3_support_ipsec,
        .hiudk_support_migr = hinic3_support_migr,
        .hiudk_support_nic = hinic3_support_nic,
        .hiudk_support_ovs = hinic3_support_ovs,
        .hiudk_support_vbs = hinic3_support_vbs,
        .hiudk_support_rdma = hinic3_support_rdma,
        .hiudk_support_roce = hinic3_support_roce,
        .hiudk_support_toe = hinic3_support_toe,
        .hiudk_vector_to_eqn = hinic3_vector_to_eqn,
        .hiudk_vf_in_pf = hinic3_vf_in_pf,
        .hiudk_func_max_nic_qnum = hinic3_func_max_nic_qnum,
        .hiudk_get_slave_host_enable = hinic3_get_slave_host_enable,
        .hiudk_get_slave_bitmap = hinic3_get_slave_bitmap,
        .hiudk_set_host_migrate_enable = hinic3_set_host_migrate_enable,
        .hiudk_get_host_migrate_enable = hinic3_get_host_migrate_enable,
        .hiudk_is_slave_func = hinic3_is_slave_func,
        .hiudk_is_master_func = hinic3_is_master_func,
        .hiudk_is_multi_bm = hinic3_is_multi_bm,
        .hiudk_is_slave_host = hinic3_is_slave_host,
        .hiudk_set_func_nic_state = hinic3_set_func_nic_state,
        .hiudk_get_netdev_state = hinic3_get_netdev_state,
        .hiudk_get_mhost_func_nic_enable = hinic3_get_mhost_func_nic_enable,
        .hiudk_get_dev_cap = hinic3_get_dev_cap,
        .hiudk_mbox_to_host_sync = hinic3_mbox_to_host_sync,
        .hiudk_get_func_vroce_enable = hinic3_get_func_vroce_enable,
        .hiudk_is_vm_slave_host = hinic3_is_vm_slave_host,
        .hiudk_is_bm_slave_host = hinic3_is_bm_slave_host,
        .hiudk_is_guest_vmsec_enable = hinic3_is_guest_vmsec_enable,
        .hiudk_get_vfid_by_vfpci = hinic3_get_vfid_by_vfpci,
        .hiudk_get_fake_vf_info = hinic3_get_fake_vf_info,
    },
    /* com_ops */
    {
        .hiudk_dma_free_coherent_align = hinic3_dma_free_coherent_align,
        .hiudk_dma_zalloc_coherent_align = hinic3_dma_zalloc_coherent_align,
    },
    /* cqm_ops */
    {
        .hiudk_cqm_bloomfilter_dec = cqm_bloomfilter_dec,
        .hiudk_cqm_bloomfilter_inc = cqm_bloomfilter_inc,
        .hiudk_cqm_cmd_alloc = cqm_cmd_alloc,
        .hiudk_cqm_cmd_free = cqm_cmd_free,
        .hiudk_cqm_fake_vf_num_set = cqm_fake_vf_num_set,
        .hiudk_cqm_function_hash_buf_clear = cqm_function_hash_buf_clear,
        .hiudk_cqm_function_timer_clear = cqm_function_timer_clear,
        .hiudk_cqm_get_db_addr = cqm_get_db_addr,
        .hiudk_cqm_get_hardware_db_addr = cqm_get_hardware_db_addr,
        .hiudk_cqm_lb_send_cmd_box = cqm_lb_send_cmd_box,
        .hiudk_cqm_lb_send_cmd_box_async = cqm_lb_send_cmd_box_async,
        .hiudk_cqm_object_delete = cqm_object_delete,
        .hiudk_cqm_object_fc_srq_create = cqm_object_fc_srq_create,
        .hiudk_cqm_object_funcid = cqm_object_funcid,
        .hiudk_cqm_object_get = cqm_object_get,
        .hiudk_cqm_object_nonrdma_queue_create = cqm_object_nonrdma_queue_create,
        .hiudk_cqm_object_offset_addr = cqm_object_offset_addr,
        .hiudk_cqm_object_put = cqm_object_put,
        .hiudk_cqm_object_qpc_mpt_create = cqm_object_qpc_mpt_create,
        .hiudk_cqm_object_rdma_queue_create = cqm_object_rdma_queue_create,
        .hiudk_cqm_object_rdma_table_get = cqm_object_rdma_table_get,
        .hiudk_cqm_object_recv_queue_create = cqm_object_recv_queue_create,
        .hiudk_cqm_object_resize_alloc_new = cqm_object_resize_alloc_new,
        .hiudk_cqm_object_resize_free_new = cqm_object_resize_free_new,
        .hiudk_cqm_object_resize_free_old = cqm_object_resize_free_old,
        .hiudk_cqm_object_share_recv_queue_add_container = cqm_object_share_recv_queue_add_container,
        .hiudk_cqm_object_share_recv_queue_create = cqm_object_share_recv_queue_create,
        .hiudk_cqm_object_srq_add_container_free = cqm_object_srq_add_container_free,
        .hiudk_cqm_ring_direct_wqe_db = cqm_ring_direct_wqe_db,
        .hiudk_cqm_ring_hardware_db = cqm_ring_hardware_db,
        .hiudk_cqm_ring_software_db = cqm_ring_software_db,
        .hiudk_cqm_send_cmd_box = cqm_send_cmd_box,
        .hiudk_cqm_send_cmd_imm = cqm_send_cmd_imm,
        .hiudk_cqm_service_register = cqm_service_register,
        .hiudk_cqm_service_unregister = cqm_service_unregister,
        .hiudk_cqm_srq_used_rq_container_delete = cqm_srq_used_rq_container_delete,
        .hiudk_cqm_timer_base = cqm_timer_base,
        .hiudk_cqm_dtoe_share_recv_queue_create = cqm_dtoe_share_recv_queue_create,
        .hiudk_cqm_dtoe_free_srq_bitmap_index = cqm_dtoe_free_srq_bitmap_index,
        .hiudk_cqm_need_secure_mem = cqm_need_secure_mem
    },
    /* hw_ops */
    {
        .hiudk_aeq_register_hw_cb = hinic3_aeq_register_hw_cb,
        .hiudk_aeq_register_swe_cb = hinic3_aeq_register_swe_cb,
        .hiudk_aeq_unregister_hw_cb = hinic3_aeq_unregister_hw_cb,
        .hiudk_aeq_unregister_swe_cb = hinic3_aeq_unregister_swe_cb,
        .hiudk_alloc_cmd_buf = hinic3_alloc_cmd_buf,
        .hiudk_alloc_db_addr = hinic3_alloc_db_addr,
        .hiudk_alloc_db_phy_addr = hinic3_alloc_db_phy_addr,
        .hiudk_api_csr_rd64 = hinic3_api_csr_rd64,
        .hiudk_ceq_register_cb = hinic3_ceq_register_cb,
        .hiudk_ceq_unregister_cb = hinic3_ceq_unregister_cb,
        .hiudk_clean_root_ctxt = hinic3_clean_root_ctxt,
        .hiudk_cmdq_detail_resp = hinic3_cmdq_detail_resp,
        .hiudk_cmdq_direct_resp = hinic3_cmdq_direct_resp,
        .hiudk_cos_id_detail_resp = hinic3_cos_id_detail_resp,
        .hiudk_event_callback = hinic3_event_callback,
        .hiudk_free_cmd_buf = hinic3_free_cmd_buf,
        .hiudk_free_db_addr = hinic3_free_db_addr,
        .hiudk_free_db_phy_addr = hinic3_free_db_phy_addr,
        .hiudk_func_reset = hinic3_func_reset,
        .hiudk_get_board_info = hinic3_get_board_info,
        .hiudk_get_hw_pf_infos = hinic3_get_hw_pf_infos,
        .hiudk_get_service_adapter = hinic3_get_service_adapter,
        .hiudk_link_event_stats = hinic3_link_event_stats,
        .hiudk_mbox_to_pf = hinic3_mbox_to_pf,
        .hiudk_mbox_to_vf = hinic3_mbox_to_vf,
        .hiudk_mbox_to_vf_no_ack = hinic3_mbox_to_vf_no_ack,
        .hiudk_msg_to_mgmt_api_chain_async = hinic3_msg_to_mgmt_api_chain_async,
        .hiudk_msg_to_mgmt_async = hinic3_msg_to_mgmt_async,
        .hiudk_msg_to_mgmt_no_ack = hinic3_msg_to_mgmt_no_ack,
        .hiudk_msg_to_mgmt_sync = hinic3_msg_to_mgmt_sync,
        .hiudk_ppf_tmr_start = hinic3_ppf_tmr_start,
        .hiudk_ppf_tmr_stop = hinic3_ppf_tmr_stop,
        .hiudk_register_mgmt_msg_cb = hinic3_register_mgmt_msg_cb,
        .hiudk_register_pf_mbox_cb = hinic3_register_pf_mbox_cb,
        .hiudk_register_ppf_mbox_cb = hinic3_register_ppf_mbox_cb,
        .hiudk_register_service_adapter = hinic3_register_service_adapter,
        .hiudk_register_vf_mbox_cb = hinic3_register_vf_mbox_cb,
        .hiudk_set_root_ctxt = hinic3_set_root_ctxt,
        .hiudk_sm_ctr_rd64 = hinic3_sm_ctr_rd64,
        .hiudk_unregister_mgmt_msg_cb = hinic3_unregister_mgmt_msg_cb,
        .hiudk_unregister_pf_mbox_cb = hinic3_unregister_pf_mbox_cb,
        .hiudk_unregister_ppf_mbox_cb = hinic3_unregister_ppf_mbox_cb,
        .hiudk_unregister_service_adapter = hinic3_unregister_service_adapter,
        .hiudk_unregister_vf_mbox_cb = hinic3_unregister_vf_mbox_cb,
        .hiudk_force_complete_all = hinic3_force_complete_all,
        .hiudk_get_ceq_page_phy_addr =  hinic3_get_ceq_page_phy_addr,
        .hiudk_set_ceq_irq_disable = hinic3_set_ceq_irq_disable,
        .hiudk_mbox_ppf_to_host = hinic3_mbox_ppf_to_host,
        .hiudk_get_ceq_info = hinic3_get_ceq_info,
        .hiudk_init_single_ceq_status = hinic3_init_single_ceq_status,
    },
    /* wq_ops */
    {
        .hiudk_wq_create = hinic3_wq_create,
        .hiudk_wq_destroy = hinic3_wq_destroy
    },
    /* dev_ops */
    {
        .hiudk_attach_nic = hinic3_attach_nic,
        .hiudk_get_chip_name = hinic3_get_chip_name,
        .hiudk_attach_service = hinic3_attach_service,
        .hiudk_detach_nic = hinic3_detach_nic,
        .hiudk_detach_service = hinic3_detach_service,
        .hiudk_get_lld_dev_by_dev_name = hinic3_get_lld_dev_by_dev_name,
        .hiudk_get_lld_dev_by_dev_name_unsafe = hinic3_get_lld_dev_by_dev_name_unsafe,
        .hiudk_get_lld_dev_by_chip_and_port = hinic3_get_lld_dev_by_chip_and_port,
        .hiudk_get_ppf_lld_dev = hinic3_get_ppf_lld_dev,
        .hiudk_get_ppf_lld_dev_unsafe = hinic3_get_ppf_lld_dev_unsafe,
        .hiudk_get_uld_dev = hinic3_get_uld_dev,
        .hiudk_get_uld_dev_unsafe = hinic3_get_uld_dev_unsafe,
        .hiudk_register_uld = hinic3_register_uld,
        .hiudk_set_vf_load_state = hinic3_set_vf_load_state,
        .hiudk_set_vf_service_load = hinic3_set_vf_service_load,
        .hiudk_set_vf_service_state = hinic3_set_vf_service_state,
        .hiudk_unregister_uld = hinic3_unregister_uld,
        .hiudk_uld_dev_hold = uld_dev_hold,
        .hiudk_uld_dev_put = uld_dev_put,
    }
};
#endif
#endif